<div class="text_field">
  <div>
    <%= form_for peer_price, 
          :as => "peer_price_#{peer_price.id}",
          :url => update_retail_price_peer_price_url(peer_price),
          :remote => true,
          :method => :put do |f|
     %> 
      <%= f.text_field :retail_price, :class => 'enter_to_submit' %> = <b id='new_peer_price_<%= peer_price.id %>_retail_price'><%= peer_price.retail_price %></b>
      <%= f.submit :class => 'hidden' %>
    <% end %>
  </div>
  <span class='close_it'>
  <%= link_to "关闭",show_retail_price_peer_price_url(peer_price),:remote => true, :method => :get, :class => 'l_crud l_close' %>
  </span>
</div>
<script type="text/javascript" charset="utf-8">
$(function() {
  $('#peer_price_<%= peer_price.id %>_retail_price').observe_field(1, function() {
    try {
      $('#new_peer_price_<%= peer_price.id %>_retail_price').html(eval($(this).val()));
    } catch(error) {
      $('#new_peer_price_<%= peer_price.id %>_retail_price').html("<b class='validation_error'>计算公式不正确</b>");
    }
  });
});
</script>